package com.atguigu.eduservice.controller.controllerVo;


import com.atguigu.commonutils.Result;
import com.atguigu.eduservice.entity.EduCourse;
import com.atguigu.eduservice.entity.EduTeacher;
import com.atguigu.eduservice.entity.vo.TeacherQuery;
import com.atguigu.eduservice.service.EduCourseService;
import com.atguigu.eduservice.service.EduTeacherService;
import com.atguigu.servicebase.handler.CustomException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author test.java
 * @since 2023-03-11
 */
@Api(value="讲师管理前台")
@RestController
@RequestMapping("/eduserviceFont/teachersInfo")
@CrossOrigin //解决跨域的问题
public class EduTeacherControllerVo {

	@Resource
	private EduTeacherService eduTeacherService;


	@ApiOperation(value = "分页讲师列表")
	@GetMapping(value = "{page}/{limit}")
	public Result pageList(
			@ApiParam(name = "page", value = "当前页码", required = true)
			@PathVariable Long page,

			@ApiParam(name = "limit", value = "每页记录数", required = true)
			@PathVariable Long limit){

		Page<EduTeacher> pageParam = new Page<EduTeacher>(page, limit);

		Map<String, Object> map = eduTeacherService.pageListWeb(pageParam);

		return  Result.ok().data(map);
	}


}

